import * as shell from 'shelljs';



/**
 * 运行命令
 */
export const run = (cmd: string) => {
  cmd = cmd.toString().trim();
  if (/^(rm|cp)/.test(cmd)) {
    const args = cmd.split(/\s+/);
    const cmd_ = args.shift();
    // @ts-ignore
    return shell[cmd_](...args);
  } else {
    return shell.exec(cmd);
  }
}

